﻿using System;
using System.Collections.Generic;
using BotonJXC.Entity;
using RegionDAO = BotonJXC.DAO.RegionDAO;
using BotonJXC.Util;
using NHibernate.Criterion;

namespace BotonJXC.BLL
{
    public class RegionBLL : BaseBLL<RegionDAO, Region, int>
    {
        public RegionBLL()
        {
        }

        public PageModel<Region> Find(string regionName, int start, int count)
        {
            List<ICriterion> criterions = new List<ICriterion>();
            if (!string.IsNullOrEmpty(regionName))
            {
                criterions.Add(Restrictions.Like("RegionName", regionName, MatchMode.Anywhere));
            }
            return Dao.FindByPage(criterions.ToArray(), null, start, count);
        }
    }
}